package com.facebook.games.fa.services
{
	import com.facebook.games.fa.util.RemoteObject;
	
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncResponder;
	import mx.rpc.IResponder;
	
	/**
	 * Serviço responsável pela manipulação dos times
	 * @author Diego Maehler <dmaehler@gmail.com>
	 */
	public class TeamService
	{
		
		private var responder : IResponder;
		private var remote : RemoteObject	= new RemoteObject("TeamService");
		private var loadTeamsOP : AbstractOperation;
		
		/**
		 * 
		 */
		public function TeamService (responder : IResponder) 
		{
			this.responder = responder;
			this.configureOperations();
		}
		
		/**
		 * Configura as operações remotas
		 */
		protected function configureOperations () : void
		{
			this.loadTeamsOP = this.remote.getOperation("loadTeams");
		}
		
		/**
		 * Carrega as equipes
		 */
		public function loadTeams () : void
		{
			this.loadTeamsOP.send().addResponder(this.responder);
		}
		
	}
}